package com.lejin.cms.service.impl;

import com.lejin.cms.entity.CourseCat;
import com.lejin.cms.mapper.CourseCatMapper;
import com.lejin.cms.service.ICourseCatService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lejin.item.entity.CourseOutline;
import com.lejin.vo.CatCascadeVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author luminghua
 * @since 2022-04-21
 */
@Service
public class CourseCatServiceImpl extends ServiceImpl<CourseCatMapper, CourseCat> implements ICourseCatService {

    @Override
    public List<CatCascadeVO> selectCatCascade() {
        return this.baseMapper.findCatCascade();
    }

    @Override
    public List<CourseOutline> selectCoursesByCatIdAndPriceAsc(String catId) {
        return this.baseMapper.findCoursesByCatIdAndPriceAsc(catId);
    }

    @Override
    public List<CourseOutline> selectCoursesByHitsDesc(String cat2Id) {
        return this.baseMapper.findCoursesByHitsDesc(cat2Id);
    }
}
